The invention relates to video processing in general. More particularly, the invention relates to a method and apparatus for managing buffers used for motion estimation.
Digital video is becoming increasingly popular because of its capability of delivering high picture quality. One problem with digital video, however, is the amount of digital data which is necessary to represent an image with high levels of detail. This in turn creates problems with storing the digital data, and transporting the digital data between individual devices (e.g., from one computer to another over a network). Consequently, various compression technologies have been developed to reduce the amount of digital data necessary to represent analog video signals, while still maintaining the high levels of quality associated with digital video.
One compression technique used to compress a video signal is referred to as motion estimation. Motion estimation is commonly utilized by video encoders in signal processing techniques that compress successive frames of digital video data (xe2x80x9cvideo framesxe2x80x9d). Motion estimation techniques exploit the temporal correlation that often exists between consecutive video frames, in which there is a tendency for objects or image features to move from one location to another on a display device from frame to frame. For example, frame 1 may contain an object, and frame 2 may contain a set of pixels corresponding to the same object spatially displaced from the location in frame 1. If frame 1 is transmitted to and received by a pixel processor or video processor (which performs any necessary decompression or other decoding), frame 2 may be transmitted without including the pixel data corresponding to the object. Instead, motion vectors (i.e., xe2x80x9cpointersxe2x80x9d) are sent along with frame 2. These motion vectors may be utilized by the receiving video processor when decoding the received video frame 2 to reproduce the object from frame 1 at a new location within frame 2. Since such motion vectors can be represented with fewer bits than the pixels that comprise the object, fewer bits need to be transmitted (or stored) in order to recreate the object in frame 2.
Several frame types are associated with motion estimation, which varies according to the type of compression standard used for encoding the video signal. For example, the Indeo(copyright) 5.0 Real Time Encoder (xe2x80x9cIRTExe2x80x9d) uses a proprietary standard developed by Intel Corporation. The Indeo Video 5.0 encoder produces the following frame types: key frames (K), predicted frames (P), second level predicted frames (P2) and disposable frames (D). Each frame type can be used as a reference frame by another frame for motion estimation according to a certain hierarchy, as shown in Table 1 as follows:
Thus, as shown in Table 1, K and P frames can be used as reference frames for P, P2 and D type of frames. The difference between K and P frames, however, is that P frames need another reference frame to be decoded correctly, whereas a K frame is self-contained. P2 frames can be used as reference frames for other P2 and D frames. D frames are not used as reference frames for any other frame type.
Video encoders/decoders (xe2x80x9cvideo codecsxe2x80x9d) using conventional motion estimation techniques, however, are unsatisfactory for a number of reasons. Most prominent is the problem of buffer management. Many video codecs utilize one or more buffers to store each frame as it is received by the codec. Each buffer has one or more memory storage units. As a video codec receives a frame, it stores the frame in a memory storage unit of one of the buffers. The buffer is managed by using at least one pointer to indicate in which memory storage unit the frame has been stored. Additional pointers may also be used to indicate the received frame""s reference frame, if the received frame is other than a K frame. The algorithms used to manage these multiple pointers, however, are relatively complicated. Further, they consume a relatively large number of processing cycles, both in the encoding and decoding stage. In addition, these algorithms are generally inefficient and tend to inappropriately overwrite data within a cache, which is a problem referred to as xe2x80x9ccache pollutionxe2x80x9d or xe2x80x9cthrashing.xe2x80x9d
In view of the foregoing, it can be appreciated that a substantial need exists for a new video codec which solves the above-discussed problems.
One embodiment of the invention comprises a method and apparatus for managing a plurality of buffers for a video codec. Each buffer has at least one memory storage unit. A first video frame is received. The first video frame is stored in a first memory storage unit. A second video frame is received, the second video frame having said first video frame as a reference frame. The second video frame is stored in a second memory storage unit, with the second memory storage unit being a first predetermined number of memory storage units from the first memory storage unit.